<?php

namespace App\Http\Controllers\Api\V1;

use App\Models\Broadcast;
use App\Http\Controllers\Api\V1\Resources\BroadcastResource;

class BroadcastsController extends Controller
{
    public function index()
    {
    	BroadcastResource::wrap('data');
    	$broadcasts = Broadcast::query()->unclosed()->unexpired()->orderByDesc('id')->get();
    	return BroadcastResource::collection($broadcasts);
    }
}
